package com.et.protocol.core;

import java.io.File;

public final class ETFileUtil {

    public static void delete(File file) {
        if (file.exists()) {
            if (file.isFile()) {
                boolean b;
                File f = new File(file.getParent(), System.currentTimeMillis() + file.getName() + ".delete");
                b = file.renameTo(f);
                if (b) b = f.delete();
            } else if (file.isDirectory()) {
                boolean b;
                File f = new File(file.getParent(), "delete" + file.getName());
                b = file.renameTo(f);
                if (b) b = f.delete();
            }
        }
    }
}
